#!/usr/bin/python
# -*- coding: utf-8 -*-

from os.path import abspath, dirname, join

from bottle import Bottle
from bottle import debug, run
from bottle import jinja2_view as view
from bottle import redirect, abort, static_file
from bottle import jinja2_template as template
from bottle import request, response, local

from web_func import get_image_type, check2mkdir

from setting import ENTRY_FILE_PATH, ENTRY_DIR_FUNC

from forms import EntryAddForm
from models import Entry

app = Bottle()

@app.route('/entry/list')
def handle_list():
    objlist = Entry.get().order_by('create_time', 'DESC')[:]

    return template('admin/entry/list', objlist=objlist)
